package com.woniu.client;

import com.woniu.commons.exception.YogaException;
import com.woniu.commons.model.Result;
import com.woniu.model.YCoach;
import com.woniu.model.YUser;
import com.woniu.model.YVenue;
import io.swagger.annotations.ApiOperation;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "account-server", path = "/account")
public interface AccountClient {


    /**
     * 根据id查找教练信息
     *
     * @param id:教练id
     * @return 对象
     */
    @GetMapping("/yCoach/byId/{id}")
    @ApiOperation("根据id查找教练信息")
    public Result<YCoach> byId(@PathVariable("id") Integer id);


    /**
     * 根据id查找场馆信息
     * @param id
     * @return
     */
    @GetMapping("/yVenue/byId/{id}")
    @ApiOperation("根据id查找场馆信息")
    public Result<YVenue> venueById(@PathVariable("id") Integer id)throws YogaException;

    /**
     * 根据id查找用户信息
     * @param userId
     * @return
     */
    @GetMapping("/yUser/loadUsersByIds")
    @ApiOperation("根据id查找用户信息")
    Result<YUser> loadUsersByIds(@SpringQueryMap Integer userId);

}
